import 'dart:ffi';

class PackageModel {
  Doctor doctor;
  Order order;
  String imGroupId;

  PackageModel({this.doctor, this.order, this.imGroupId});

  PackageModel.fromJson(Map<String, dynamic> json) {
    doctor =
        json['doctor'] != null ? new Doctor.fromJson(json['doctor']) : null;
    order = json['order'] != null ? new Order.fromJson(json['order']) : null;
    imGroupId = json['im_group_id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.doctor != null) {
      data['doctor'] = this.doctor.toJson();
    }
    if (this.order != null) {
      data['order'] = this.order.toJson();
    }
    data['im_group_id'] = this.imGroupId;
    return data;
  }
}

class Doctor {
  String name;
  String title;
  String hospital;
  String department;
  String avatar;
  String sId;

  Doctor(
      {this.name,
      this.title,
      this.hospital,
      this.department,
      this.avatar,
      this.sId});

  Doctor.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    title = json['title'];
    hospital = json['hospital'];
    department = json['department'];
    avatar = json['avatar'];
    sId = json['_id'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['title'] = this.title;
    data['hospital'] = this.hospital;
    data['department'] = this.department;
    data['avatar'] = this.avatar;
    data['_id'] = this.sId;
    return data;
  }
}

class Order {
  String orderId;
  String wxOrderId;
  String name;
  int beginAt;
  int endAt;
  String icon;
  String desc;
  num price;
  num vipPrice;
  num vipDiscountsPrice;
  bool isPatientInfo;
  bool isExpire;
  bool isNeedPay;
  String servicePackageRefType;
  String url;
  String patientName;
  String patientAge;
  String patientSex;
  String serviceType;
  int orderStatus;
  int dieaseCaseCount;
  int appointmentCount;
  int appointmentTotalCount;
  String pregnantWeekStr;
  int lastMenstruation;
  String servicePackageOrderId;

  Order(
      {this.orderId,
      this.wxOrderId,
      this.name,
      this.beginAt,
      this.endAt,
      this.icon,
      this.desc,
      this.price,
      this.vipPrice,
      this.vipDiscountsPrice,
      this.isPatientInfo,
      this.isExpire,
      this.isNeedPay,
      this.servicePackageRefType,
      this.url,
      this.patientName,
      this.patientAge,
      this.patientSex,
      this.serviceType,
      this.orderStatus,
      this.dieaseCaseCount,
      this.appointmentCount,
      this.appointmentTotalCount,
      this.pregnantWeekStr,
      this.lastMenstruation});

  Order.fromJson(Map<String, dynamic> json) {
    orderId = json['orderId'];
    wxOrderId = json['wxOrderId'];
    name = json['name'];
    beginAt = json['beginAt'];
    endAt = json['endAt'];
    icon = json['icon'];
    desc = json['desc'];
    price = json['price'];
    vipPrice = json['vipPrice'];
    vipDiscountsPrice = json['vipDiscountsPrice'];
    isPatientInfo = json['is_patient_info'];
    isExpire = json['is_expire'];
    isNeedPay = json['is_need_pay'];
    servicePackageRefType = json['service_package_ref_type'];
    url = json['url'];
    patientName = json['patientName'];
    patientAge = json['patientAge'];
    patientSex = json['patientSex'];
    serviceType = json['serviceType'];
    orderStatus = json['orderStatus'];
    dieaseCaseCount = json['diease_case_count'];
    appointmentCount = json['appointment_count'];
    appointmentTotalCount = json['appointment_total_count'];
    pregnantWeekStr = json['pregnant_week_str'];
    lastMenstruation = json['last_menstruation'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['orderId'] = this.orderId;
    data['wxOrderId'] = this.wxOrderId;
    data['name'] = this.name;
    data['beginAt'] = this.beginAt;
    data['endAt'] = this.endAt;
    data['icon'] = this.icon;
    data['desc'] = this.desc;
    data['price'] = this.price;
    data['vipPrice'] = this.vipPrice;
    data['vipDiscountsPrice'] = this.vipDiscountsPrice;
    data['is_patient_info'] = this.isPatientInfo;
    data['is_expire'] = this.isExpire;
    data['is_need_pay'] = this.isNeedPay;
    data['service_package_ref_type'] = this.servicePackageRefType;
    data['url'] = this.url;
    data['patientName'] = this.patientName;
    data['patientAge'] = this.patientAge;
    data['patientSex'] = this.patientSex;
    data['serviceType'] = this.serviceType;
    data['orderStatus'] = this.orderStatus;
    data['diease_case_count'] = this.dieaseCaseCount;
    data['appointment_count'] = this.appointmentCount;
    data['appointment_total_count'] = this.appointmentTotalCount;
    data['pregnant_week_str'] = this.pregnantWeekStr;
    data['last_menstruation'] = this.lastMenstruation;
    return data;
  }
}

